<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<!-- 开发环境版本，包含了有帮助的命令行警告 -->
	<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	<title></title>
</head>
<body>
	<div id="app">
		<h2>{{count}}</h2>
		<button v-on:click="addCount">点</button><br>
		<!-- v-on的简写方法 -->
		<button @click="addCount">点</button><br>
		<input type="text" v-on:focus="alertMsg"/>
	</div>
	<script type="text/javascript">
		var app=new Vue({
			el:"#app",
			data:{
				count:0
			},
			methods:{
				addCount(){
					this.count++
				},
				alertMsg(){
					alert("msg...");
				}
			}
		})
	</script>
</body>
</html>